<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/xizhongren8980/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/xizhongren8980/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/xizhongren8980/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/xizhongren8980/images/logo.svg" color="#222">

<link rel="stylesheet" href="/xizhongren8980/css/main.css">


<link rel="stylesheet" href="/xizhongren8980/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"gitee.com","root":"/xizhongren8980/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="跟着一个视频课准备做一个小小的Web实践项目，需要连接数据库，现简单记录一下过程。 一、使用微软的SQL Server尝试过很多次都没成功">
<meta property="og:type" content="article">
<meta property="og:title" content="IntelliJ IDEA连接MySQL数据库">
<meta property="og:url" content="https://gitee.com/xizhongren8980/xizhongren8980.git/2020/04/07/idea%E8%BF%9E%E6%8E%A5MySQL%E6%95%B0%E6%8D%AE%E5%BA%93/index.html">
<meta property="og:site_name" content="一杯茶一包烟，一个BUG改一天">
<meta property="og:description" content="跟着一个视频课准备做一个小小的Web实践项目，需要连接数据库，现简单记录一下过程。 一、使用微软的SQL Server尝试过很多次都没成功">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/01.png">
<meta property="og:image" content="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/02.png">
<meta property="og:image" content="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/03.png">
<meta property="og:image" content="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/04.png">
<meta property="og:image" content="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/05.png">
<meta property="og:image" content="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/06.png">
<meta property="og:image" content="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/07.png">
<meta property="og:image" content="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/08.png">
<meta property="og:image" content="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/09.png">
<meta property="og:image" content="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/10.png">
<meta property="og:image" content="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/11.png">
<meta property="og:image" content="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/12.png">
<meta property="og:image" content="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/13.png">
<meta property="og:image" content="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/14.png">
<meta property="og:image" content="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/15.png">
<meta property="og:image" content="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/16.png">
<meta property="og:image" content="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/17.png">
<meta property="og:image" content="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/18.png">
<meta property="og:image" content="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/19.png">
<meta property="og:image" content="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/20.png">
<meta property="og:image" content="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/21.png">
<meta property="article:published_time" content="2020-04-07T13:45:15.161Z">
<meta property="article:modified_time" content="2020-04-09T13:58:04.585Z">
<meta property="article:author" content="MisterTian">
<meta property="article:tag" content="数据库">
<meta property="article:tag" content="IDEA">
<meta property="article:tag" content="MySQL">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/01.png">

<link rel="canonical" href="https://gitee.com/xizhongren8980/xizhongren8980.git/2020/04/07/idea%E8%BF%9E%E6%8E%A5MySQL%E6%95%B0%E6%8D%AE%E5%BA%93/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>IntelliJ IDEA连接MySQL数据库 | 一杯茶一包烟，一个BUG改一天</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/xizhongren8980/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">一杯茶一包烟，一个BUG改一天</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">收藏永不停止，学习永不开始</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/xizhongren8980/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/xizhongren8980/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/xizhongren8980/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/xizhongren8980/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/xizhongren8980/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://gitee.com/xizhongren8980/xizhongren8980.git/2020/04/07/idea%E8%BF%9E%E6%8E%A5MySQL%E6%95%B0%E6%8D%AE%E5%BA%93/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/xizhongren8980/images/head.jpg">
      <meta itemprop="name" content="MisterTian">
      <meta itemprop="description" content="一个小菜鸟">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="一杯茶一包烟，一个BUG改一天">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          IntelliJ IDEA连接MySQL数据库
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2020-04-07 21:45:15" itemprop="dateCreated datePublished" datetime="2020-04-07T21:45:15+08:00">2020-04-07</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2020-04-09 21:58:04" itemprop="dateModified" datetime="2020-04-09T21:58:04+08:00">2020-04-09</time>
              </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p>跟着一个视频课准备做一个小小的Web实践项目，需要连接数据库，现简单记录一下过程。</p>
<h3 id="一、使用微软的SQL-Server尝试过很多次都没成功"><a href="#一、使用微软的SQL-Server尝试过很多次都没成功" class="headerlink" title="一、使用微软的SQL Server尝试过很多次都没成功"></a>一、使用微软的SQL Server尝试过很多次都没成功<a id="more"></a></h3><p>在学习数据库课程时，使用的就是SQL Server，于是我开始尝试连接idea，但是折腾许久还是没能成功，也不知道是不是我的操作不当，以后有机会一定再试试。</p>
<p>后来没办法，就只好再装一个MySQL了。</p>
<h3 id="二、使用MySQL数据库连接idea（前提条件见第三部分）"><a href="#二、使用MySQL数据库连接idea（前提条件见第三部分）" class="headerlink" title="二、使用MySQL数据库连接idea（前提条件见第三部分）"></a>二、使用MySQL数据库连接idea（前提条件见第三部分）</h3><h4 id="1、下载"><a href="#1、下载" class="headerlink" title="1、下载"></a>1、下载</h4><p><a href="https://dev.mysql.com/downloads/installer/" target="_blank" rel="noopener">https://dev.mysql.com/downloads/installer/</a><br>官网下载链接，如果没有翻墙的话估计很慢。</p>
<p><img src="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/01.png" alt=""></p>
<h4 id="2、安装"><a href="#2、安装" class="headerlink" title="2、安装"></a>2、安装</h4><p>安装除了需要自己输入一下数据库的密码以外，其他默认就可以了。</p>
<p><a href="https://blog.csdn.net/bobo553443/article/details/81383194" target="_blank" rel="noopener">安装教程</a>安装可参考这个博客。</p>
<p>默认安装路径如图</p>
<p><img src="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/02.png" alt=""></p>
<h4 id="3、使用命令行创建一个新的数据库"><a href="#3、使用命令行创建一个新的数据库" class="headerlink" title="3、使用命令行创建一个新的数据库"></a>3、使用命令行创建一个新的数据库</h4><p>下载完成后，打开MySQL Server文件夹下的bin文件夹，在这里进入终端。</p>
<p><img src="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/03.png" alt=""></p>
<ul>
<li><p>使用数据库管理员身份登录数据库<code>mysql -u root -p</code></p>
</li>
<li><p>输入登录密码，就是之前安装时填写的密码</p>
</li>
</ul>
<p><img src="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/04.png" alt=""></p>
<ul>
<li>查询一下数据库<code>show databases</code></li>
</ul>
<p><img src="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/05.png" alt=""></p>
<p>查询出来的这些数据库都是mysql系统数据库，会包括一些配置文件，千万别删除了。</p>
<ul>
<li>创建一个空的数据库<code>create database 数据库名称</code></li>
</ul>
<p>如图建立一个<code>test_1</code>的测试数据库，建立完成之后再查询，就已经可以看到刚刚建立的<code>test_1</code>数据库了。</p>
<p><img src="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/06.png" alt=""></p>
<p>接下来进入idea与刚刚这个<code>test_1</code>数据库进行连接。</p>
<h4 id="4、在IDEA中连接MySQL数据库"><a href="#4、在IDEA中连接MySQL数据库" class="headerlink" title="4、在IDEA中连接MySQL数据库"></a>4、在IDEA中连接MySQL数据库</h4><ul>
<li>打开idea，找到Database-&gt;点击“+”-&gt;Data Source-&gt;MySQL</li>
</ul>
<p><img src="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/07.png" alt=""></p>
<ul>
<li>连接<code>test_1</code>数据库</li>
</ul>
<p><img src="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/08.png" alt=""></p>
<ul>
<li>测试连接</li>
</ul>
<p><img src="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/09.png" alt=""></p>
<p>可以看到，报错了，这个错误解决办法如下<br><img src="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/10.png" alt=""></p>
<p>找到<code>serverTimezone</code>，修改后面的值为<code>UTC</code></p>
<p><img src="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/11.png" alt=""></p>
<ul>
<li>再次测试连接</li>
</ul>
<p>可以看到连接成功了。<br><img src="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/12.png" alt=""></p>
<h3 id="三、第二部分能连接的前提是要有数据库对应的Driver"><a href="#三、第二部分能连接的前提是要有数据库对应的Driver" class="headerlink" title="三、第二部分能连接的前提是要有数据库对应的Driver"></a>三、第二部分能连接的前提是要有数据库对应的<code>Driver</code></h3><p>添加好的如图<br><img src="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/13.png" alt=""></p>
<h4 id="添加方法有两种"><a href="#添加方法有两种" class="headerlink" title="添加方法有两种"></a>添加方法有两种</h4><ul>
<li>直接在idea添加，idea自动下载（不推荐）</li>
</ul>
<p><img src="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/14.png" alt=""></p>
<p>这个方法成功率低，受网络影响很大。</p>
<p><img src="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/15.png" alt=""></p>
<ul>
<li>自己下载驱动（Driver）</li>
</ul>
<p>进入<a href="https://dev.mysql.com/downloads/connector/j/" target="_blank" rel="noopener">官网下载</a>，点击如图</p>
<p><img src="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/16.png" alt=""></p>
<p>注意最好要与自己idea提示的版本相同，下载其他版本请点击如图所示</p>
<p><img src="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/17.png" alt=""></p>
<p><img src="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/18.png" alt=""></p>
<p>下载好后解压</p>
<p><img src="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/19.png" alt=""></p>
<ul>
<li>idea添加驱动jar包</li>
</ul>
<p>点击MySQL-&gt;”+”</p>
<p><img src="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/20.png" alt=""></p>
<p>找到解压文件夹下的jar包即可</p>
<p><img src="https://gitee.com/xizhongren8980/Hexo_src/raw/master/idea%E8%BF%9E%E6%8E%A5MySQL/21.png" alt=""></p>
<h4 id="添加成功，再回到第二部分进行连接"><a href="#添加成功，再回到第二部分进行连接" class="headerlink" title="添加成功，再回到第二部分进行连接"></a>添加成功，再回到第二部分进行连接</h4><p>在使用MySQL连接时基本上就只有以上的地方需要特别注意，而使用微软的SQL Server连接时，我遇到的问题就很多了，具体原因有待了解。</p>

    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/xizhongren8980/tags/%E6%95%B0%E6%8D%AE%E5%BA%93/" rel="tag"># 数据库</a>
              <a href="/xizhongren8980/tags/IDEA/" rel="tag"># IDEA</a>
              <a href="/xizhongren8980/tags/MySQL/" rel="tag"># MySQL</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/xizhongren8980/2020/04/07/SQL%20Server%E6%9B%B4%E6%94%B9%E8%BA%AB%E4%BB%BD%E9%AA%8C%E8%AF%81%E7%99%BB%E5%BD%95/" rel="prev" title="SQL Server更改身份验证登录">
      <i class="fa fa-chevron-left"></i> SQL Server更改身份验证登录
    </a></div>
      <div class="post-nav-item">
    <a href="/xizhongren8980/2020/04/14/445%E9%A2%98%E4%B9%8B%E4%B8%A4%E6%95%B0%E7%9B%B8%E5%8A%A0/" rel="next" title="【LeetCode】445题之两数相加">
      【LeetCode】445题之两数相加 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#一、使用微软的SQL-Server尝试过很多次都没成功"><span class="nav-number">1.</span> <span class="nav-text">一、使用微软的SQL Server尝试过很多次都没成功</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#二、使用MySQL数据库连接idea（前提条件见第三部分）"><span class="nav-number">2.</span> <span class="nav-text">二、使用MySQL数据库连接idea（前提条件见第三部分）</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#1、下载"><span class="nav-number">2.1.</span> <span class="nav-text">1、下载</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#2、安装"><span class="nav-number">2.2.</span> <span class="nav-text">2、安装</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#3、使用命令行创建一个新的数据库"><span class="nav-number">2.3.</span> <span class="nav-text">3、使用命令行创建一个新的数据库</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#4、在IDEA中连接MySQL数据库"><span class="nav-number">2.4.</span> <span class="nav-text">4、在IDEA中连接MySQL数据库</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#三、第二部分能连接的前提是要有数据库对应的Driver"><span class="nav-number">3.</span> <span class="nav-text">三、第二部分能连接的前提是要有数据库对应的Driver</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#添加方法有两种"><span class="nav-number">3.1.</span> <span class="nav-text">添加方法有两种</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#添加成功，再回到第二部分进行连接"><span class="nav-number">3.2.</span> <span class="nav-text">添加成功，再回到第二部分进行连接</span></a></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="MisterTian"
      src="/xizhongren8980/images/head.jpg">
  <p class="site-author-name" itemprop="name">MisterTian</p>
  <div class="site-description" itemprop="description">一个小菜鸟</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/xizhongren8980/archives/">
        
          <span class="site-state-item-count">57</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/xizhongren8980/categories/">
          
        <span class="site-state-item-count">7</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/xizhongren8980/tags/">
          
        <span class="site-state-item-count">101</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>


  <div class="links-of-blogroll motion-element">
    <div class="links-of-blogroll-title"><i class="fa fa-link fa-fw"></i>
      友情链接
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <a href="https://mistertian8980.github.io/" title="https:&#x2F;&#x2F;mistertian8980.github.io&#x2F;" rel="noopener" target="_blank">Github博客</a>
        </li>
    </ul>
  </div>

      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">MisterTian</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> 强力驱动
  </div>

        








      </div>
    </footer>
  </div>

  
  <script size="300" alpha="0.6" zIndex="-1" src="/xizhongren8980/lib/canvas-ribbon/canvas-ribbon.js"></script>
  <script src="/xizhongren8980/lib/anime.min.js"></script>
  <script src="/xizhongren8980/lib/velocity/velocity.min.js"></script>
  <script src="/xizhongren8980/lib/velocity/velocity.ui.min.js"></script>

<script src="/xizhongren8980/js/utils.js"></script>

<script src="/xizhongren8980/js/motion.js"></script>


<script src="/xizhongren8980/js/schemes/pisces.js"></script>


<script src="/xizhongren8980/js/next-boot.js"></script>


  <script defer src="//cdn.jsdelivr.net/gh/theme-next/theme-next-three@1/three.min.js"></script>
    <script defer src="//cdn.jsdelivr.net/gh/theme-next/theme-next-three@1/canvas_lines.min.js"></script>


  




  
<script src="/xizhongren8980/js/local-search.js"></script>













  

  

</body>
</html>
